[Perf][SM70] Reduce Qwen3.8 no-MTP token latency - #481
Merged
yangzhuxinyzx merged 23 commits intoSep 5, 2026
Merged
Conversation
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Contributor
Author
|
Exact no-MTP follow-up evidence:
No activation/HC quantization, lower-precision accumulator, approximate top-k, or relaxed quality gate is used. Focused Python tests pass; the initial CI failure was limited to clang-format plus the repository torch.accelerator policy and is fixed in 355c67e. |
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Contributor
Author
|
Added exact TP4 HyperConnection compute sharding in 728b501.
This raises isolated exact projected savings since the current-main trace to 0.884 ms/token. A full endpoint A/B is still required; this is not yet a 100 tok/s claim. |
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
…tp-token-trace-20260903-173451
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
This was referenced Sep 4, 2026
Preserve FP32 reductions and FP16 boundaries while gathering 640 mixed hidden values per rank. Keep older communicator DSOs on the gate-sharded route. Record real-weight screens and reject slower publication/split prototypes; add reproducible production and auxiliary-stream gates. Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Record exact real-weight TP4 and auxiliary-stream CUDA Graph results, paired Mix-only timings, runtime/toolchain, and process cleanup. Keep full-model acceptance separate. Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
yangzhuxinyzx
marked this pull request as ready for review
September 5, 2026 07:39
This was referenced Sep 5, 2026
Peuqui
pushed a commit
to Peuqui/1Cat-vLLM
that referenced
this pull request
Sep 6, 2026
Preserve the completed e76a9c8 trace contract separately from this integration merge. PR 1CatAI#481 was merged at 205acfb; norm prefetch and further HC work remain under review. Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Reduce Qwen3.8 Flash Next NVFP4 TP4/V100 single-request no-MTP latency without lowering precision. This remains a Draft: the 100 tok/s / 10 ms per token endpoint target is not established by isolated operator timings.
Original task base:
05910abb97446128a259fbd5fbe2bf9ece70a492. Current integration merge base:fbcef6e2f959e95bbe4ca807931abfa2393546e7.Implemented scope
benchmarks/kernels/benchmark_sm70_hc_tp4.py: all 96 real HC weight pairs through registered production dispatch, forced old-route control, CUDA Graph timing, and concurrent auxiliary-stream sum2 correctness.benchmarks/kernels/benchmark_sm70_hc_full_chain.py: complete semantic HC graph including combine/norm and final projections, with intermediate FP16 bit checks and GPU ownership checks around timing groups.0303b82d1enow ports the selected vector/parallel-gate 160-CTA fused up/mix/gather to production binding/facade/model dispatch. It appends 21,120 bytes of private packet/counter storage per rank, keeps legacy HC/MoE layouts unchanged, and uses the existing FP16 HC opt-in with owner-DSO capability fallbacks. No weight copy or new user flag. CPU owner/fallback tests: 20 passed; selected SM70 kernel compiles with31 registers/192 bytes shared/zero stack or spills. The registered GPU gate (complete-chain A/B, 512 auxiliary sum2 replays, post-tag-wrap exactness) is queued; no whole-model claim is made from the prototype.Registered GPU gate now passed (
0303b82d1e): full semantic HC 2.109529 -> 1.994807 ms, saving 0.114722 ms / 5.44%. Three fused samples1.994807/1.993735/1.996370 ms. Four ranks, 16 changing input cases, all intermediate/final outputs, 512 actual auxiliary-stream sum2 graph replays, and post-timing tag-wrap checks have zero FP16 bit mismatches. Sidecar SHA2565b1ee678bebf6a8fcdb008d5832cfd8ca3d6978558291ec9fe54ec2b9f6cf1bf; result SHA256b9524acfe04ea92ca3836a404ae590284dc6ea0b8ee4ddfd3a3488e9653a9996. No full model started. The 1.5-ms goal and whole-model output/trace gate remain unachieved; a distinct exact down/gather packet prototype is the next screen.Latest follow-up (
8f74e4b88b): reject the exact down/gather packet fusion (1.989379 -> 2.218926 ms, bitwise but slower). Admit norm-weight early loading only for SM70/FP16/N1/HC4/H2560, leaving prefill and other shapes unchanged. Registered full-HC norm A/B, with up fusion fixed: 1.982525 -> 1.944255 ms (save0.038270ms/1.93%), all four ranks x16inputs plus post-timing outputs bitwise. Five targeted norm dispatch tests pass; the previous 20 owner/fallback tests remain the up-port evidence.A whole-model attempt selected fused HC during graph capture but the quality harness failed before generation on chat-tokenizer Mapping-vs-list handling; all owned model workers were shut down. This is recorded, not claimed as quality or trace success. CPU preflight now validates explicit integer chat IDs before LLM creation, and the matching installed QdstrmImporter successfully converts old raw traces. The old HC core bucket is reproduced as2.658072ms; complete semantic attribution including final-mixer work is2.701252ms rank-average GPU service. A corrected single-load natural-quality/baseline/trace run is queued. The1.5ms whole-model goal and final256K quality gate remain unachieved.
Full HC <= 1.5 ms follow-up
The user's next target is the complete HC chain below 1.5 ms/token, without precision reduction, accepted with a matched whole-model trace and quality gate. This target is not yet achieved.
At frozen kernel source
50f9fbe374, the portable complete-HC microbenchmark measures old gate-sharded 2.277540 ms versus current hidden-sharded 2.111058 ms (three samples2.109891/2.111399/2.111058). All intermediate/final outputs pass bitwise over 16 changing inputs on four ranks. This is not a2.658 -> 2.111 mswhole-model speedup: the old trace used a narrower name-based bucket, and the isolated workload excludes core attention/MoE/PLE computation.New losing variants are recorded, not admitted: exact combine/norm + down fusion with 0/4/40 weight-chunk prefetch, vector-packed down weights, and joint down/up packing. Up-only packing saves just
0.013476 msin a paired screen and is not admitted on this evidence alone. A physical down expansion passed bitwise but its contended timings are invalid. No production numerical contract changed, and no full model was started for these screens.The next experiment targets hidden-sharded up/local mix/output gathering with private per-CTA epochs, distinct from the previously rejected branch-sharded fusion with a global completion counter. The implementation remains local until exactness and complete-chain gains are demonstrated.
That follow-up now has results: 80-CTA local/fused
2.265607/2.180970 msversus2.105945 mscontrol; 160-CTA local/fused2.161794/2.103446 msand 320-CTA2.139696/2.183004 msversus2.108150 mscontrol. The best net gain is only0.004704 ms; none is admitted. Initial bitwise checks and post-generation-146593 checks pass on four ranks. An LDG128 revision passed its initial exactness check but its timing was rejected when another GPU task entered. The runner now honors that suite's separate reservation across model restarts. A final vector-load/parallel-branch-gate screen is compiled and queued, not a production result.Latest prototype result: the queued vector-load/parallel-branch-gate screen completed successfully. Complete-HC control 2.108826 ms -> 160-CTA fused 1.999374 ms, saving 0.109452 ms / 5.19%. Three fused samples:
1.999995/1.999374/1.998002 ms. Local-only is2.068084 ms; 80-CTA fused is2.082618 msand is not selected. All four ranks pass intermediate/final bitwise checks over 16 changing inputs and after generation146593 (two packet-tag wraps). There is no packed-weight copy or numerical-contract change. This remains an artifact prototype awaiting production dispatch/capability fallback and auxiliary-stream sum2 validation, then a consolidated whole-model trace/quality gate. It does not establish a2.658 -> 1.999 msfull-model reduction or satisfy the 1.5-ms goal. All task-owned tests/queues have exited.HC results and rejected directions
All values below are 96 Mix-only graph calls; they exclude combine/RMSNorm and are not full-HC trace service sums or endpoint TPOT.
The first publication version was also rejected (2.229951 ms). Hidden tile alternatives were bitwise but slower. All screen variants passed 96 real weight pairs × 16 changing inputs × four ranks with zero FP16 bit mismatches. Three paired timing groups use 150 replays each after 1,000 warmups. Raw local evidence is indexed in the migration control document.
Committed production result (
aaf63696b6): registered old/new dispatch measures 1.738595 → 1.690003 ms, saving 0.048592 ms / 2.79% per 96 Mix calls. Three samples are old1.738315/1.739291/1.738595, new1.689020/1.690590/1.690003; ranges are below 0.1%. This supersedes the prototype's 0.041-ms projection, not the existing endpoint baseline.Test plan and current results
.venv/bin/python -m pytest -q tests/distributed/test_custom_all_reduce_dispatch.py: 13 passed, including four communicator-DSO ownership/capability combinations.git diff --check: passed..venv/bin/python -m pytest -q tests/models/qwen4_exp/test_sm70_fp16_gemv.py -k hc_up_hidden_shards: 1 passed, 18 deselected.2.10.0+cu128, CUDA12.8, Tesla V100-SXM2-32GB TP4; sidecar compiled by NVCC12.0.140. Binary SHA256a1fa27c23aea3ee2a7030017ee404c9d2bcb1f3c03889461a070c1f4daded4dd. Raw resultproduction_result.jsonSHA2566bf2c047430e586bf1814fbf8ae0fd09a335d4c59decc8d6fff4c5ca6aa37750; logs indexed in the worklog.Non-duplication and review
This continues existing PR #481, not a second HC/per-token-latency PR. Upstream SGLang/FlashInfer ideas were used as design references; architecture-specific persistent atomic or Blackwell implementations were not copied into the SM70 path. Losing experiments remain out of production dispatch.
AI assistance (OpenAI Codex) was used for implementation, operator experiments, and documentation. Human review is required before merging or endpoint promotion. Commits are DCO-signed.